/**============================================================================
 Confidential Information - Limited distribution to authorized persons only.
 This software is protected as an unpublished work under the U.S. Copyright
 Act of 1976.

 Copyright (c) 2011, BluePhoenix Solutions, Inc. All rights reserved.
 ----------------------------------------------------------------------------
 file......: NotepadColumnMapper.java
 Author....: Vyacheslav Kovalyov
 Created...: 28.10.11

 Description:

 ============================================================================*/
package ru.monyag.pred.swing.ui.notepad;

import ru.monyag.pred.core.notepad.Note;
import ru.monyag.pred.swing.ui.table.BaseColumnMapper;

import static ru.monyag.pred.swing.ui.notepad.NotepadTableModelInfo.*;

/**
 * @author Vyacheslav Kovalyov
 * @version 1.0
 */
public class NotepadColumnMapper extends BaseColumnMapper<Note> {

    @Override
    public Object getValueAt(Note note, int index) {
        switch (index) {
            case DATE:
                return note.getDate();
            case MESSAGE:
                return note.getMessage();
            case TITLE:
                return note.getTitle();
            case TAGS:
                return note.getTagsString();
        }

        return super.getValueAt(note, index);
    }
}
